﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="quanlycacdotruttham.aspx.cs"  MasterPageFile="~/Administrator/Admin.master" Inherits="Administrator_quanlycacdotruttham" %>


<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <%--<iframe name="framename" scrolling=no width="100%" src="Default.aspx">
N&#7871;u b&#7841;n nìn th&#7845;y dòng ch&#7919; này, t&#7913;c là trình duy&#7879;t c&#7911;a b&#7841;n không h&#7895; tr&#7907; inlineframe.
</iframe>--%>
<!-- content start -->

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>                  
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
                    <telerik:AjaxUpdatedControl ControlID="Label2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
           
            
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <br />
   
    <div>
        <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080"></asp:Label>
        <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000"></asp:Label>
    </div>
    <br/>
   
    <telerik:RadGrid ID="RadGrid1" AutoGenerateEditColumn="True" Skin="Office2007" runat="server"
        AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
        AllowPaging="True"  DataSourceID="SqlDataSource2"  AllowSorting="True" 
        OnPreRender="RadGrid1_PreRender"  OnItemInserted="RadGrid1_ItemInserted" 
        OnItemUpdated="RadGrid1_ItemUpdated" AutoGenerateDeleteColumn="True" 
        CellSpacing="0" GridLines="None">
        <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="PointBackage_id">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>

            <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit PointBackage_id: {0}"
                    CaptionDataField="PointBackage_id" >
                <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
        <FooterStyle ForeColor="Yellow" />
        <HeaderStyle Font-Size="Small" />

<FilterMenu EnableImageSprites="False"></FilterMenu>

<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Vista"></HeaderContextMenu>
    </telerik:RadGrid>
    <br />
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:up1vnConnectionString %>"
        DeleteCommand="DELETE FROM [PointBackage] WHERE [PointBackage_id] = @PointBackage_id" InsertCommand="INSERT INTO [PointBackage] ([PointBackage_id],[PointBackage_name], [PointBackage_Point],  [PointBackage_award1], [PointBackage_award2],[PointBackage_award3], [cumulative_time],[status]) VALUES (@PointBackage_id,@PointBackage_name, @PointBackage_Point, @PointBackage_award1, @PointBackage_award2, @PointBackage_award3, @cumulative_time,@status)"
        SelectCommand="SELECT [PointBackage_id] ,[PointBackage_name] , [PointBackage_Point] ,  [PointBackage_award1] , [PointBackage_award2],[PointBackage_award3] , [cumulative_time] ,[status] FROM [PointBackage]" UpdateCommand="UPDATE [PointBackage] SET [PointBackage_name] = @PointBackage_name, [PointBackage_Point] = @PointBackage_Point, [PointBackage_award1] = @PointBackage_award1, [PointBackage_award2] = @PointBackage_award2, [PointBackage_award3] = @PointBackage_award3, [cumulative_time] = @cumulative_time,[status] = @status WHERE [PointBackage_id] = @PointBackage_id">
        <DeleteParameters>
       <%-- SELECT  PointBackage_Name as ten  , PointBackage_Id, PointBackage_Point, PointBackage_award1, PointBackage_award2, PointBackage_award3,cumulative_time FROM PointBackage--%>
            <asp:Parameter Name="PointBackage_id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>     
        <asp:Parameter Name="PointBackage_id" Type="Int32" />      
           <asp:Parameter Name="PointBackage_name" Type="String"  />
            <asp:Parameter Name="PointBackage_name" Type="String"  />
            <asp:Parameter Name="PointBackage_Point" Type="String" />
            <asp:Parameter Name="PointBackage_award1" Type="String" />
            <asp:Parameter Name="PointBackage_award2" Type="String" />
            <asp:Parameter Name="PointBackage_award3" Type="String" />
            <asp:Parameter Name="cumulative_time" Type="DateTime" />
           <asp:Parameter Name="status" Type="Boolean" />
        </InsertParameters>
        <UpdateParameters>    
           <asp:Parameter Name="PointBackage_id" Type="Int32" />      
            <asp:Parameter Name="PointBackage_name" Type="String" />
            <asp:Parameter Name="PointBackage_Point" Type="String"  />
            <asp:Parameter Name="PointBackage_award1" Type="String" />
            <asp:Parameter Name="PointBackage_award2" Type="String" />
            <asp:Parameter Name="PointBackage_award3" Type="String" />
            <asp:Parameter Name="cumulative_time" Type="DateTime" />
                <asp:Parameter Name="status" Type="Boolean"/>
        </UpdateParameters>
    </asp:SqlDataSource>
    <!-- content end -->
</asp:Content>